choicescriptdevfandomcom-20200216-history
Setting up ChoiceScript
This article is aimed at beginners to ChoiceScript. However, if you have not already done so then the best place to start would be with the very first article in this Introduction To ChoiceScript Game Development series of linked articles: A Basic Tutorial. Getting Started N.B: This article describes setting up ChoiceScript ready to develop your game using the traditional text editor / browser approach. Using either of the two main development tools — 'Chronicler' or 'CSIDE' — makes things easier as you '''don't' need to download your own copy of ChoiceScript, nor will you have to keep it updated in future.'' Before starting to code in ChoiceScript using a simple text editor, you need the ChoiceScript SDK (Software Development Kit); You can download the latest ChoiceScript .zip directly, or visit its Github page. Zip is a file format used for data compression and archiving, so the ChoiceScript .zip contains lots of different files, already sorted into folders. After you download the file, you will need to "extract" it. N.B: If you are using Windows, when you download the file, right click on it and select properties. At the very bottom of the properties window there will be a button that says '''Unblock'. Select that button and press OK before extracting. This will help prevent a possible error that can result from those earlier versions of Windows automatically "blocking" the files because they originated from a different computer.'' Open the file (double click) and at the top of the window there will be a button that says Extract All Files. Click it, then on the window that pops up, select Browse then Desktop (or wherever else you want the game). After it's done extracting there will be a new folder (which starts with dfabulich-choicescript) on your desktop, in which will be the files for ChoiceScript. However, the only files most ChoiceScript authors need concern themselves with are the text files located in the 'scenes' folder (..web\mygame\scenes). Playing the Example Game ChoiceScript comes complete with the text files for a simple game, to show new authors how a game is laid out and provide some scripting examples. You can run the game locally in your browser using the index.html file found in the 'mygame' folder (..\web\mygame), although you cannot use Chrome for this purpose. While playng the simple example game, we highly recommend opening startup.txt in a text editor to study the scripting there, and compare that to what is happening in the game each time you click Next. When the game indicates Next Chapter instead, it is about to load another new text scene file -- find that filename in your 'scenes' folder and open that one in your text editor as well. Continue following the scripting in the text files with each click you make in the game, to get a feel for how the story is branching according to the choices the player is making in the game. Setting up Your Own Game When you feel that you have a vague inkling of the basic idea behind how ChoiceScript works, go to the "scenes" folder (..web\mygame\scenes) and delete all the scene .txt files found there with the exception of choicescript_stats.txt and startup.txt. Now open both choicescript_stats.txt and startup.txt in your text editor and delete all the actual contents of both files, then save them again as blank files. Do not in any way change the name or location of either file. That's it; you're now ready to begin scripting your first game with ChoiceScript! (Well, almost ready...) Next Tutorial Article: Structure of a ChoiceScript game Related articles *Structure of a ChoiceScript game *startup.txt *Scenes *Stats and stats screen *index.html Category:Tutorials